﻿using MigSharp;
using System.Data;

namespace CmsDatabaseMigrations.Migrations
{
    [MigrationExport(ModuleName = "Add PageKey to Pages table", Tag = "Pages")]
    public class AddPageKey20130909 : IReversibleMigration
    {
        private const string PageKey = "PageKey";
        private const string DbName = "Pages";

        public void Up(IDatabase db)
        {
            db.Tables[DbName].AddNullableColumn(PageKey, DbType.String).OfSize(255);
        }

        public void Down(IDatabase db)
        {
            db.Tables[DbName].Columns[PageKey].Drop();
        }
    }
}